// https://leetcode.cn/problems/longest-increasing-subsequence/description/

class Solution {
public:
    int lengthOfLIS(vector<int>& nums) {
        vector<int> f(3000, 1);
        int n = nums.size();
        
        for (int i = 0; i < n; i++)   
            for (int j = 0; j < i; j++)
                if (nums[j] < nums[i])
                    f[i] = max(f[i], f[j] + 1);
        
        return *max_element(f.begin(), f.end());
    }
};